Do not call validate_visible_area() from the draw method
authorKristian Rietveld <kris@gtk.org>
Thu, 14 Oct 2010 15:26:17 +0000 (17:26 +0200)
committerKristian Rietveld <kris@gtk.org>
Thu, 14 Oct 2010 15:26:17 +0000 (17:26 +0200)
commitaeec832f0e88f059f0c3b0ea19577febb8f6bdcc
treef3af0506f46a6a87d2259e96afdef3a71cfe0c4d
parent4fc31dd87a91398aa92e3ecd9702ca1487352cc3
Do not call validate_visible_area() from the draw method

Because validate_visible_area() can modify the window size (and thus
the underlying surface), it should not be called from within the draw
method.  Given that the presize handler is run with a higher priority
than redraw, and the presize handler will validate the visible area,
there should not be cases wherein the draw method is called and
validate_visible_area() has not been run yet.

However, one such a case was gdk_window_process_updates(), which would
trigger the draw method at some point.  We now work around this
by factoring this in a new gtk_tree_view_bin_process_updates() function
that will run the presize handler first if needed.

Note: for other platforms, it might still be the case that the draw
method is called and validate_visible_area() has not been run yet.
(For example the Mac backend calls gdk_window_process_updates() from
the drawRect method, and the redraw-in-idle handling thus works
differently).  This does not seem to be a problem now, if
it will be in the future we need to take care of that then.
gtk/gtktreeview.c